package com.enjoyor.soa.traffic.core.tpcms.mapper.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.enjoyor.soa.traffic.api.dto.tpcms.RltBayonetZoneDto;
import com.enjoyor.soa.traffic.core.tpcms.constant.RltBayonetZoneSqlId;
import com.enjoyor.soa.traffic.core.tpcms.domain.RltBayonetZone;
import com.enjoyor.soa.traffic.core.tpcms.mapper.IRltBayonetZoneMapper;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;

@Service
@Transactional
public class RltBayonetZoneMapper extends BaseMapper<RltBayonetZone> implements IRltBayonetZoneMapper {

    @Override
    public List<RltBayonetZone> selectByRltId(String relationId) {
        return sqlSessionTemplate.selectList(getSqlName(RltBayonetZoneSqlId.SQL_SELECT_LIST), relationId);
    }

    public void insert(RltBayonetZone rltBayonetZone) {
        rltBayonetZone.setRltId(String.valueOf(System.nanoTime()));
        super.insert(rltBayonetZone);
    }

    @Override
    public void insertRltBayonet(RltBayonetZone rltBayonetZone) {
        sqlSessionTemplate.insert(getSqlName(RltBayonetZoneSqlId.SQL_INSERT), rltBayonetZone);
    }

    @Override
    public void deleteRltBayonet(Map<String, Object> map) {
        sqlSessionTemplate.delete(getSqlName(RltBayonetZoneSqlId.SQL_DELETE), map);
    }

    @Override
    public void insertRltBayonetBatch(List<RltBayonetZone> rltBayonetZoneList) {
        sqlSessionTemplate.insert(getSqlName(RltBayonetZoneSqlId.SQL_INSERT), rltBayonetZoneList);
    }

}
